package com.kangyi.user.service.Impl;

import cn.hutool.core.collection.CollUtil;
import com.kangyi.constant.MessageConstant;
import com.kangyi.dto.FeeQueryDTO;
import com.kangyi.exception.DataNotExistException;
import com.kangyi.user.mapper.FeeMapper;
import com.kangyi.user.service.FeeService;
import com.kangyi.vo.FeeVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Blank
 * @version 1.0
 */
@Service
public class FeeServiceImpl implements FeeService {

    @Autowired
    private FeeMapper feeMapper;

    @Override
    public List<FeeVO> inquiryNursingHomeFee(FeeQueryDTO feeQueryDTO) {
        List<FeeVO> feeVOList = feeMapper.inquiryNursingHomeFee(feeQueryDTO);

        if (CollUtil.isEmpty(feeVOList)) {
            throw new DataNotExistException(MessageConstant.DATA_NOT_EXIST);
        }

        return feeVOList;
    }
}
